Matthias Clasen [Mon, 24 Feb 2020 13:01:19 +0000 (08:01 -0500)]
surface: Add a getter for autohide
Matthias Clasen [Mon, 24 Feb 2020 18:35:27 +0000 (13:35 -0500)]
gdk: Drop GdkDevice::input-mode and rename ::input-source
Drop the input-mode, since it only makes sense for
floating devices, which we don't have anymore. And renamt
::input-source to ::source, to match the getter.
Update all users.
Matthias Clasen [Mon, 24 Feb 2020 13:00:11 +0000 (08:00 -0500)]
device: Add missing getters
This adds getters for a few properties that were
missing them, and renames the input-mode and input-source
properties to match their existing getters.
Matthias Clasen [Mon, 24 Feb 2020 12:39:20 +0000 (07:39 -0500)]
Add a getter for GdkAppLaunchContext::display
Matthias Clasen [Mon, 24 Feb 2020 13:22:22 +0000 (08:22 -0500)]
Fix the build with docs
This is fallout from filechooser api changes.
Matthias Clasen [Mon, 24 Feb 2020 00:32:23 +0000 (00:32 +0000)]
Merge branch 'wip/ebassi/filechooser-new' into 'master'
Clean up the GtkFileChooser API
Closes #2455
See merge request GNOME/gtk!1454
Matthias Clasen [Mon, 24 Feb 2020 00:23:11 +0000 (00:23 +0000)]
Merge branch '138-gtk4-install-valgrind-suppressions' into 'master'
build: Install Valgrind suppressions files
Closes #138
See merge request GNOME/gtk!1467
Matthias Clasen [Mon, 24 Feb 2020 00:03:09 +0000 (00:03 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
broadway: Remove SURFACE_IS_TOPLEVEL
See merge request GNOME/gtk!1469
Matthias Clasen [Sun, 23 Feb 2020 23:15:59 +0000 (18:15 -0500)]
broadway: Remove SURFACE_IS_TOPLEVEL
All surfaces are toplevels now.
Philip Chimento [Sun, 23 Feb 2020 23:00:37 +0000 (15:00 -0800)]
build: Install Valgrind suppressions files
This is so that other programs linking to GTK can use GTK's suppressions
files when performing their own Valgrind analysis.
Closes: #138
Piotr Drąg [Sun, 23 Feb 2020 11:32:30 +0000 (12:32 +0100)]
Update POTFILES.in
Matthias Clasen [Sun, 23 Feb 2020 01:50:52 +0000 (01:50 +0000)]
Merge branch 'wip/otte/dnd' into 'master'
Get rid of GdkAtom
See merge request GNOME/gtk!1465
Benjamin Otte [Sun, 23 Feb 2020 00:54:38 +0000 (01:54 +0100)]
gdk: Remove GdkAtom
finally!!!!!
Benjamin Otte [Sun, 23 Feb 2020 00:43:42 +0000 (01:43 +0100)]
win32: Get rid of GdkAtom
Benjamin Otte [Sun, 23 Feb 2020 00:36:49 +0000 (01:36 +0100)]
wayland: Replace final mention of GdkAtom
Benjamin Otte [Sun, 23 Feb 2020 00:33:56 +0000 (01:33 +0100)]
x11: Get rid of GdkAtom and APIs supporting it.
replace all uses with const char * (non-interned).
Also remove a lot fo juggling from atom to GdkAtom to string and back.
The X Atom hash table is now mapping to (again, non-interned) strings.
Benjamin Otte [Sat, 22 Feb 2020 22:31:24 +0000 (23:31 +0100)]
device: gdk_device_list_axes() => gdk_device_get_axis_names()
Turn a GList of GdkAtom into a char ** - and rename the function to not
cause problems.
Benjamin Otte [Sat, 22 Feb 2020 22:15:25 +0000 (23:15 +0100)]
gdk: Remove gdk_text_property_to_utf8_list_for_display()
A lot of files became empty now, so they have been removed, which makes
this commit seem larger than it is.
Benjamin Otte [Sat, 22 Feb 2020 21:52:30 +0000 (22:52 +0100)]
Don't use GdkAtom where const char * is used
Those are all forgotten transitions while updating code to new APIs.
Benjamin Otte [Sat, 22 Feb 2020 17:33:20 +0000 (18:33 +0100)]
gdk: Remove gdk_utf8_to_string_target()
Only keep the X11 version around in the backend.
Benjamin Otte [Sat, 22 Feb 2020 17:18:00 +0000 (18:18 +0100)]
selection: Remove GtkSelectionData
Benjamin Otte [Sat, 22 Feb 2020 16:36:58 +0000 (17:36 +0100)]
droptarget: Remove selectiondata read functions
They are unused now.
Benjamin Otte [Sat, 22 Feb 2020 16:16:56 +0000 (17:16 +0100)]
filechooserwidget: Stop using selection data
Use gdk_drop_read_async()
Benjamin Otte [Sat, 22 Feb 2020 15:08:46 +0000 (16:08 +0100)]
x11: Register DND atoms with all other atoms
It's 2020, there's no need to be restrained with registering atoms.
Benjamin Otte [Sat, 22 Feb 2020 14:56:36 +0000 (15:56 +0100)]
gdk: Remove gdk_surface_register_dnd()
All surfaces are expected to be DND surfaces from creation.
Matthias Clasen [Sun, 23 Feb 2020 00:21:54 +0000 (00:21 +0000)]
Merge branch 'x11-dnd-fixes' into 'master'
X11 dnd fixes
See merge request GNOME/gtk!1464
Matthias Clasen [Sat, 22 Feb 2020 23:50:28 +0000 (18:50 -0500)]
Add detail to gdk_drag_begin docs
Mention that GTK keeps a reference while the drag
operation is ongoing.
Matthias Clasen [Sat, 22 Feb 2020 23:44:55 +0000 (18:44 -0500)]
x11: Fix dnd coordinate handling
We were not properly converting the coordinates we
got to root coordinates. This was showing up as offsets
between the actual drop target and the area where drops
can happen, e.g. when dragging over a stack switcher
to switch pages.
Matthias Clasen [Sun, 23 Feb 2020 00:09:18 +0000 (19:09 -0500)]
x11: Export gdk_x11_surface_get_root_coords privately
This lets us avoid a roundtrip through the surface vfuncs.
Matthias Clasen [Sat, 22 Feb 2020 23:32:37 +0000 (18:32 -0500)]
x11: Keep a ref on GdkDrag objects
It is expected that backends keep a ref on the GdkDrag
objects that they create as long as the drag is ongoing.
Matthias Clasen [Sat, 22 Feb 2020 22:44:36 +0000 (17:44 -0500)]
x11: Avoid crashes in dnd
We were forgetting to clean up the ::xevent signal
handler in some error cases. Move the signal connection
later, when we know the drag is going forward, and
use g_signal_connect_object to make sure the signal
handler is not forgotten.
Matthias Clasen [Sat, 22 Feb 2020 20:51:32 +0000 (20:51 +0000)]
Merge branch 'wip/wayland-fix-popup-grabs' into 'master'
Fix Wayland popup grabs
See merge request GNOME/gtk!1463
Jonas Ådahl [Sat, 22 Feb 2020 19:09:38 +0000 (20:09 +0100)]
wayland/popup: Emit un-withdrawn event earlier
Otherwise grabbing the seat will appear to have failed.
Jonas Ådahl [Sat, 22 Feb 2020 19:08:37 +0000 (20:08 +0100)]
wayland/popup: Remove unnecessary checks when mapping popup
We only call this when we're not already mapped so don't check that. We
also only call this when we should be mapped so don't check that either.
Matthias Clasen [Sat, 22 Feb 2020 19:01:18 +0000 (19:01 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Fix a hard-to-spot typo
See merge request GNOME/gtk!1462
Matthias Clasen [Sat, 22 Feb 2020 18:49:12 +0000 (13:49 -0500)]
Fix a hard-to-spot typo
The symptom caused by this was scales in
popovers not reacting to dragging.
Emmanuele Bassi [Sat, 22 Feb 2020 18:07:11 +0000 (18:07 +0000)]
docs: Add migration notes for GtkFileChooser
Matthias Clasen [Sat, 22 Feb 2020 16:41:29 +0000 (16:41 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
x11: Fix a crash in event handling
See merge request GNOME/gtk!1461
Matthias Clasen [Sat, 22 Feb 2020 16:41:29 +0000 (16:41 +0000)]
x11: Fix a crash in event handling
This was overlooked in
79b4510c6d687c.
Emmanuele Bassi [Sat, 22 Feb 2020 16:39:01 +0000 (16:39 +0000)]
Remove preview widget from GtkFileChooser
The preview widget harks from a platform before time, when we didn't
have GIO, or a thumbnail specification.
Very few applications use it correctly, if at all; it has an horrid hack
to deal with the ownership of the widget's instance when accessed
through the getter function; it messes up the layout of the widget and
its label is less than useful when it comes to file names longer than a
dozen characters; it's a poor substitute for a proper thumbnail view.
Matthias Clasen [Sat, 22 Feb 2020 15:43:37 +0000 (10:43 -0500)]
Fix gdk docs build
Emmanuele Bassi [Sat, 22 Feb 2020 15:20:53 +0000 (15:20 +0000)]
Remove GtkFileChooserEntry:local-only
We don't use it any more in GtkFileChooserWidget.
Emmanuele Bassi [Sat, 22 Feb 2020 15:16:13 +0000 (15:16 +0000)]
Remove GtkPlacesSidebar:local-only
We don't use it any more in GtkFileChooserWidget.
Emmanuele Bassi [Sat, 22 Feb 2020 15:03:31 +0000 (15:03 +0000)]
Remove GtkPlacesView:local-only
We don't use it any more from the file chooser widget.
Emmanuele Bassi [Sat, 22 Feb 2020 14:54:48 +0000 (14:54 +0000)]
Remove GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
We don't need a whole separate action, now that the file chooser widget
can create folders; we can create use SELECT_FOLDER and create one.
Emmanuele Bassi [Fri, 21 Feb 2020 16:44:39 +0000 (16:44 +0000)]
Remove GtkFileChooser:local-only
Now that the whole API goes through GFile we don't have the weird split
between local-only and non-local-only modes.
Emmanuele Bassi [Fri, 21 Feb 2020 16:28:31 +0000 (16:28 +0000)]
Remove GtkFileChooser:show-hidden
This is a user setting and a user action, not something that ought to be
programmatically set via the file selection API.
Emmanuele Bassi [Fri, 21 Feb 2020 15:52:47 +0000 (15:52 +0000)]
Remove overwrite confirmation machinery from GtkFileChooser
Overwrite confirmation should not be optional, and it should not loop
into application code to create their own dialog and user response.
Emmanuele Bassi [Fri, 21 Feb 2020 15:34:37 +0000 (15:34 +0000)]
Drop GtkFileChooser:extra-widget
We have "choices" as a more rational (and portable) API; additionally,
the ownership semantics of the extra widget property getter are a hack.
Emmanuele Bassi [Fri, 21 Feb 2020 15:11:15 +0000 (15:11 +0000)]
Remove filename/URI API from GtkFileChooser
GtkFileChooser's API predates GIO by a few years, so it started off with
filenames and URI as character arrays. After introducing GIO as a
dependency, the API included GFile-based entry points.
It's much more appropriate to use GFile everywhere, as we want to
encourage people to use GIO instead of passing random bytes to low level
POSIX API.
See: #2455
Benjamin Otte [Sat, 22 Feb 2020 14:53:13 +0000 (14:53 +0000)]
Merge branch 'wip/otte/dnd' into 'master'
stuff
See merge request GNOME/gtk!1460
Matthias Clasen [Sat, 22 Feb 2020 03:18:05 +0000 (22:18 -0500)]
Remove GdkSeatGrabPrepareFunc from headers
It is not used in public api anymore.
Matthias Clasen [Sat, 22 Feb 2020 03:03:28 +0000 (22:03 -0500)]
Add a warning when a grab fails
This reveals that the grabs for popover menus
always fail now, causing the menus to not properly
hide.
Benjamin Otte [Sat, 22 Feb 2020 06:44:16 +0000 (07:44 +0100)]
tests: Guard variables with necessary macros
Benjamin Otte [Sat, 22 Feb 2020 06:42:13 +0000 (07:42 +0100)]
treeviewcolumn: Inline variable into return_if_fail()
Benjamin Otte [Sat, 22 Feb 2020 06:41:14 +0000 (07:41 +0100)]
testsuite: Don't use g_return_if_fail()
Use g_assert()
Benjamin Otte [Sat, 22 Feb 2020 06:35:23 +0000 (07:35 +0100)]
testsuite: Don't use return_if_fail()
Use assert() instead
Benjamin Otte [Sat, 22 Feb 2020 06:08:39 +0000 (07:08 +0100)]
treeview: Guard code by right compiler macros
Benjamin Otte [Sat, 22 Feb 2020 06:06:55 +0000 (07:06 +0100)]
scrolledwindow: Inline variable into return_if_fail()
Benjamin Otte [Sat, 22 Feb 2020 06:01:55 +0000 (07:01 +0100)]
iconview: Inline variables into return_if_fail()
Benjamin Otte [Sat, 22 Feb 2020 06:01:38 +0000 (07:01 +0100)]
levelbar: Guard function by right compiler macros
Benjamin Otte [Sat, 22 Feb 2020 05:58:32 +0000 (06:58 +0100)]
filesystemmodel: Guard variable with correct compiler flags
Benjamin Otte [Sat, 22 Feb 2020 05:57:32 +0000 (06:57 +0100)]
combobox: Inline variables into return_if_fail()
Benjamin Otte [Sat, 22 Feb 2020 05:55:08 +0000 (06:55 +0100)]
comboboxtext: Inline functions into return_if_fail()
Benjamin Otte [Sat, 22 Feb 2020 05:53:46 +0000 (06:53 +0100)]
device: Inline function into return_if_fail()
Benjamin Otte [Sat, 22 Feb 2020 05:53:16 +0000 (06:53 +0100)]
drop: Guard variable with correct compiler flags
Benjamin Otte [Sat, 22 Feb 2020 05:50:58 +0000 (06:50 +0100)]
surface: Inline function
Fixes compile error with -DG_DISBALE_CHECKS
Benjamin Otte [Sat, 22 Feb 2020 03:27:06 +0000 (04:27 +0100)]
main: Don't synthesize crossing events when nothing changed
This was especially bad because it was confusing the event controllers
so much, they'd emit leave + enter events every time the mouse moved.
Benjamin Otte [Sat, 22 Feb 2020 03:16:42 +0000 (04:16 +0100)]
stackswitcher: Use GdkDropControllerMotion
... and use one controller per button instead of using it on the
switcher and then going through lots of pain attempting to find the
right button for the location under the mouse.
Benjamin Otte [Sat, 22 Feb 2020 03:09:02 +0000 (04:09 +0100)]
Port simple cases to GtkDropControllerMotion
Benjamin Otte [Sat, 22 Feb 2020 03:05:22 +0000 (04:05 +0100)]
testsuite: Check proper notify emissions, too
This is in particular relevant for the ::is-focus property, because
updating that one doesn't cause enter/leave events.
But it also checks that notify and enter/leave happen in the right
order.
Benjamin Otte [Fri, 21 Feb 2020 23:58:57 +0000 (00:58 +0100)]
Add GtkDropControllerMotion
Benjamin Otte [Fri, 21 Feb 2020 22:26:36 +0000 (23:26 +0100)]
eventcontrollermotion: Fix docs
Benjamin Otte [Wed, 19 Feb 2020 03:44:41 +0000 (04:44 +0100)]
gtk: Bubble drag events like motion events
Emit crossing events - with a new GTK_CROSSING_DROP type - like we do
for motion events. There is no more special casing for them.
Note that the gesture has not been updated yet, so some obscure behavior
may occur.
Benjamin Otte [Wed, 19 Feb 2020 03:43:03 +0000 (04:43 +0100)]
events: Use GdkDrop as event sequence
This allows treating drop events like touch events, which GTK groups by
event sequence.
It's a bit ugly that we just case the GdkDrop pointer, but event
sequences are only meant to be unique pointer ids, so it's fine.
Benjamin Otte [Sat, 22 Feb 2020 04:46:58 +0000 (05:46 +0100)]
widget: Simplify adjust_allocation()
And in particular, only do it if the widget doesn't use ALIGN_FILL.
This avoids lots of measuring in the common case and speeds up
size_allocate() by about 25%.
And because size_allocate() is the bottleneck in the fishbowl, this also
gets ~25% more fishies.
Benjamin Otte [Sat, 22 Feb 2020 04:25:14 +0000 (05:25 +0100)]
widget: Pull margin computation out of adjust_allocation
It's way cheaper to just do it.
Also simplifies adjust_size_allocation a lot.
Benjamin Otte [Sat, 22 Feb 2020 04:23:41 +0000 (05:23 +0100)]
sizerequest: Stop clamping for_size to natural size
Widgets should be given the actual size they will be allocated, so they
can do something with it.
If they want to clamp themselves to their natural size, nothing's
stopping them, they know their natural size after all.
Benjamin Otte [Sat, 22 Feb 2020 01:47:41 +0000 (02:47 +0100)]
widget: Don't check for natives
It's the native's job to request a 1px x 1px size, not the job of
gtk_widget_size_allocate()
Also saves 10% of size_allocate() time because checking for an interface
is really expensive.
Benjamin Otte [Sat, 22 Feb 2020 03:49:52 +0000 (04:49 +0100)]
Ensure all natives request at least a 1px wide surface
FIXME: Is this necessary?
Could the surfaces just clamp to 1x1 themselves?
We recently declared that surfaces can decide on whatever size they want
so natives need to inspect the size they requested anyway.
Matthias Clasen [Sat, 22 Feb 2020 03:19:01 +0000 (03:19 +0000)]
Merge branch 'color-float-fix' into 'master'
color chooser: Fix fallout from floatification
See merge request GNOME/gtk!1459
Matthias Clasen [Sat, 22 Feb 2020 00:56:44 +0000 (19:56 -0500)]
color chooser: Fix fallout from floatification
We are using (dddd) variants to store colors in variants,
which is dangerous now that GdkRGBA members are just floats.
Avoid passsing the GdkRGBA members directly to any varargs
functions.
Matthias Clasen [Sat, 22 Feb 2020 00:27:59 +0000 (00:27 +0000)]
Merge branch 'wip/xdg-popup-layout-no-op' into 'master'
gdk/wayland: Avoid relayout with the same properties
See merge request GNOME/gtk!1457
Matthias Clasen [Sat, 22 Feb 2020 00:26:42 +0000 (00:26 +0000)]
Merge branch 'wip/gdkpopuplayout-section' into 'master'
docs: Add GdkPopupLayout to gdk4-sections.txt
See merge request GNOME/gtk!1458
Jonas Ådahl [Fri, 21 Feb 2020 22:24:38 +0000 (23:24 +0100)]
docs: Add GdkPopupLayout to gdk4-sections.txt
Jonas Ådahl [Fri, 21 Feb 2020 20:30:42 +0000 (21:30 +0100)]
gdk/wayland: Avoid relayout with the same properties
When a popup is already showing, and gdk_surface_present_popup() is
called, if the layout didn't change, we're not really interested in
relayouting.
In the future, we'll be able to get notified if position of the popup
would change by some environmental changes, but until then, just don't
support it.
Jonas Ådahl [Fri, 21 Feb 2020 20:28:03 +0000 (21:28 +0100)]
gdk/popup-layout: Remove leftover struct field
The layouts never "seal", as they did in an earlier revision, so remove
the seal field.
Benjamin Otte [Fri, 21 Feb 2020 20:35:47 +0000 (20:35 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
surface: Don't take a display argument in gdk_surface_new_popup()
See merge request GNOME/gtk!1456
Benjamin Otte [Fri, 21 Feb 2020 20:13:09 +0000 (21:13 +0100)]
surface: Don't take a display argument in gdk_surface_new_popup()
The display can be taken from the surface, it must not be different.
Benjamin Otte [Fri, 21 Feb 2020 18:24:56 +0000 (18:24 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master
See merge request GNOME/gtk!1455
Benjamin Otte [Fri, 21 Feb 2020 17:30:13 +0000 (18:30 +0100)]
transform: Don't crash for gsk_transform_transform (id, id)
See attached tests
Benjamin Otte [Fri, 21 Feb 2020 17:25:05 +0000 (18:25 +0100)]
transform: Make sure the identity transform is equal to NULL
Benjamin Otte [Wed, 19 Feb 2020 03:41:28 +0000 (04:41 +0100)]
x11: When clearing old Drop, emit LEAVE event
This can happen when the old DND operation died (like due to a crash or
a broken XWayland compositor.
Benjamin Otte [Wed, 19 Feb 2020 02:37:23 +0000 (03:37 +0100)]
gdk: Make DRAG_ENTER event take x/y coordinates
Make it mirror the behavior of ENTER/LEAVE events.
Benjamin Otte [Wed, 19 Feb 2020 23:02:19 +0000 (00:02 +0100)]
transform: Add optimization for common case
Transforming identity by an other transform does not mean we need to
painstakingly apply the individual steps of other to construct a new
transform, it means we can just return other.
Or in math terms:
I * B = B
so just return B.
Piotr Drąg [Fri, 21 Feb 2020 17:11:15 +0000 (18:11 +0100)]
Update POTFILES.in
Matthias Clasen [Fri, 21 Feb 2020 12:26:19 +0000 (07:26 -0500)]
profiling: Avoid one extra printf
We already format the message, no need to use
printf again to combine that with the kind string.
Matthias Clasen [Fri, 21 Feb 2020 12:23:40 +0000 (07:23 -0500)]
profiling: Avoid criticals
With events no longer GObjects, the type class is
longer around for peeking.
Matthias Clasen [Fri, 21 Feb 2020 06:18:25 +0000 (06:18 +0000)]
Merge branch 'readonly-events-1' into 'master'
Redo events
See merge request GNOME/gtk!1443
Matthias Clasen [Fri, 21 Feb 2020 02:29:00 +0000 (21:29 -0500)]
docs: Remove some no-longer existing api